import { Entity, Column } from "typeorm";
import { BaseEntity } from "../cores/entry.core/base.entity";

@Entity("webxue_file")
export class FileEntity extends BaseEntity {

  @Column({ type: "varchar", length: 200, comment: "相对url", nullable: true })
  url: string;

  @Column({ type: "varchar", length: 300, comment: "完整url" })
  full_url: string;

  @Column({ type: "varchar", length: 50, comment: "文件存储介质", nullable: true })
  medium: Medium;

  @Column({ type: "varchar", length: 200, comment: "当时的token", nullable: true })
  token: string;

  @Column({ type: "varchar", length: 50, comment: "七牛云过期时间戳", nullable: true })
  deadline:string;
}

// 文件存储介质 local(本地) qiniu(七牛)
export type Medium = "local" | "qiniu";
